-- GENERATED SPELL FOR [Auchenai Initiate] --


function spell0_21284(pUnit, Event) --@Knockdown,n/a--
pUnit:FullCastSpellOnTarget(37592,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21284', 1000, 1)
end

function spell1_21284(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(38619,pUnit)
pUnit:RegisterEvent('Sorts_21284', 585, 1)
end

function spell2_21284(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(38618,pUnit)
pUnit:RegisterEvent('Sorts_21284', 2000, 1)
end

function Sorts_21284(pUnit, Event)
local choix_sorts_21284 = math.random(0, 2)
if choix_sorts_21284 == 0 then
pUnit:RegisterEvent('spell0_21284', 1, 1)
end
if choix_sorts_21284 == 1 then
pUnit:RegisterEvent('spell1_21284', 1, 1)
end
if choix_sorts_21284 == 2 then
pUnit:RegisterEvent('spell2_21284', 1, 1)
end
end

function mob21284_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21284', math.random(1500, 3000), 1)
end

function mob21284_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21284_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21284_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21284, 1, 'mob21284_Action')
RegisterUnitEvent(21284, 2, 'mob21284_Leave')
RegisterUnitEvent(21284, 3, 'mob21284_Kill')
RegisterUnitEvent(21284, 4, 'mob21284_Die')
